package cn.wolfcode.tieba.controller;

import cn.wolfcode.tieba.domain.Posted;
import cn.wolfcode.tieba.domain.Reply;
import cn.wolfcode.tieba.query.ReplyQuery;
import cn.wolfcode.tieba.service.IReplyService;
import cn.wolfcode.tieba.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;

/**
* 回复表控制层
*/
@RestController
@RequestMapping("reply")
public class ReplyController {
    @Autowired
    private IReplyService replyService;

    @GetMapping("/save")
    public Object save(Reply reply){
        //回帖
        reply.setCreateTime(new Date());
        replyService.save(reply);
        return JsonResult.success();
    }
}
